package edu.zjut.hjg.saas.common.support.velocityTool;

public class WordTool {
    public String max(String str, int maxLength) {
        return this.max(str, maxLength, "...");
    }

    public String max(String str, int maxLength, String replaceOfOver) {
        if (str == null) {
            return "";
        }
        int l = str.length();
        return l > maxLength ? str.substring(0, maxLength) + replaceOfOver : str;
    }
}
